<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DeepSeek-Coder-V2 技术文档</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            line-height: 1.6;
            color: #333;
            background-color: #f8fafc;
        }
        .hero-bg {
            background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
        }
        .code-block {
            background: #2d3748;
            color: #e2e8f0;
            border-radius: 0.5rem;
            overflow-x: auto;
        }
        .feature-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .section-divider {
            height: 1px;
            background: linear-gradient(90deg, rgba(226, 232, 240, 0) 0%, rgba(226, 232, 240, 1) 50%, rgba(226, 232, 240, 0) 100%);
        }
        .table-container {
            overflow-x: auto;
        }
        table {
            min-width: 100%;
            border-collapse: separate;
            border-spacing: 0;
        }
        th, td {
            padding: 12px 16px;
            text-align: left;
            border-bottom: 1px solid #e2e8f0;
        }
        th {
            background-color: #f1f5f9;
            font-weight: 600;
        }
        tr:hover td {
            background-color: #f8fafc;
        }
        .first-letter {
            float: left;
            font-size: 3.5rem;
            line-height: 1;
            margin-right: 0.5rem;
            margin-top: 0.25rem;
            color: #2563eb;
            font-weight: 700;
        }
        .mermaid-container {
            background: white;
            padding: 1.5rem;
            border-radius: 0.5rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        }
    </style>
</head>
<body class="antialiased">
    <!-- Hero Section -->
    <section class="hero-bg text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl flex flex-col md:flex-row items-center">
            <div class="md:w-1/2 md:pr-10">
                <h1 class="text-4xl md:text-5xl font-bold mb-4 leading-tight">DeepSeek-Coder-V2</h1>
                <h2 class="text-2xl md:text-3xl font-semibold mb-6 text-blue-200">下一代代码生成与理解AI</h2>
                <p class="text-lg mb-8 text-blue-100 leading-relaxed">采用创新的MoE架构，128K上下文支持，338种编程语言覆盖，为开发者提供前所未有的代码生成、理解和优化能力。</p>
                <div class="flex flex-wrap gap-4">
                    <a href="#download" class="bg-white text-blue-600 hover:bg-blue-50 px-6 py-3 rounded-lg font-semibold transition duration-300">模型下载</a>
                    <a href="https://coder.deepseek.com/sign_in" target="_blank" class="border border-white text-white hover:bg-white hover:text-blue-600 px-6 py-3 rounded-lg font-semibold transition duration-300">在线体验</a>
                </div>
            </div>
            <div class="md:w-1/2 mt-10 md:mt-0">
                <div class="relative">
                    <div class="absolute inset-0 bg-blue-400 rounded-xl opacity-75 transform rotate-1"></div>
                    <div class="relative bg-white rounded-xl overflow-hidden shadow-xl transform -rotate-1">
                        <div class="p-4 bg-gray-800 flex items-center">
                            <div class="flex space-x-2">
                                <div class="w-3 h-3 rounded-full bg-red-500"></div>
                                <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
                                <div class="w-3 h-3 rounded-full bg-green-500"></div>
                            </div>
                            <div class="ml-4 text-gray-300 text-sm font-mono">terminal</div>
                        </div>
                        <div class="p-4 text-gray-800 font-mono text-sm">
                            <span class="text-green-400">$</span> python -m vllm.entrypoints.api_server \<br>
                            &nbsp;&nbsp;--model deepseek-ai/DeepSeek-Coder-V2-Instruct<br><br>
                            <span class="text-green-400">$</span> curl -X POST http://localhost:8000/generate \<br>
                            &nbsp;&nbsp;-H "Content-Type: application/json" \<br>
                            &nbsp;&nbsp;-d '{
                            <span class="text-yellow-300">"prompt": "# 实现快速排序",</span><br>
                            &nbsp;&nbsp;&nbsp;&nbsp;<span class="text-yellow-300">"max_tokens": 256</span>
                            }'
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-5xl px-4 md:px-0 py-16">
        <!-- Features Section -->
        <section id="features" class="mb-20">
            <div class="flex items-center mb-12">
                <div class="w-12 h-1 bg-blue-500 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">核心特性</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-16">
                <div class="feature-card bg-white p-8 rounded-xl shadow-md transition duration-300">
                    <div class="text-blue-500 mb-4">
                        <i class="fas fa-microchip text-3xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-4 text-gray-800">技术架构创新</h3>
                    <ul class="space-y-3 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>混合专家模型(MoE)</strong>：将模型拆分为多个专家模块，显著提升推理效率与灵活性</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>128K tokens上下文</strong>：支持跨文件代码理解与大型项目开发</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>338种编程语言</strong>：覆盖Python、Java、Rust等主流开发场景</span>
                        </li>
                    </ul>
                </div>
                
                <div class="feature-card bg-white p-8 rounded-xl shadow-md transition duration-300">
                    <div class="text-blue-500 mb-4">
                        <i class="fas fa-tachometer-alt text-3xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-4 text-gray-800">性能优势</h3>
                    <ul class="space-y-3 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>对标GPT-4-Turbo</strong>：在HumanEval等基准测试中表现优异</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>数学推理能力超越</strong>：优于Claude 3 Opus和Gemini 1.5 Pro</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>低成本推理</strong>：推理成本仅为同类闭源模型的1/10</span>
                        </li>
                    </ul>
                </div>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-16">
                <div class="p-6 md:p-8">
                    <h3 class="text-xl font-bold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-plus-circle text-blue-500 mr-2"></i> 新增功能
                    </h3>
                    <div class="grid md:grid-cols-2 gap-8">
                        <div>
                            <h4 class="font-semibold text-gray-800 mb-2">代码解释与修复</h4>
                            <p class="text-gray-700">自动解释代码逻辑，诊断错误并提供修复建议</p>
                        </div>
                        <div>
                            <h4 class="font-semibold text-gray-800 mb-2">动态分辨率支持</h4>
                            <p class="text-gray-700">与DeepSeek-VL2结合时，支持图像理解与代码生成联动</p>
                        </div>
                    </div>
                </div>
                <div class="bg-gray-50 p-6 border-t border-gray-200">
                    <img src="https://cdn.nlark.com/yuque/0/2025/png/21449790/1743602557611-9c3e931e-111a-4702-b331-ebf46cb855a7.png" alt="DeepSeek-Coder-V2性能对比" class="w-full rounded-lg">
                </div>
            </div>
            
            <!-- Mermaid Diagram -->
            <div class="mermaid-container mb-16">
                <div class="mermaid">
                    graph TD
                        A[DeepSeek-Coder-V2] --> B[技术架构]
                        A --> C[性能优势]
                        A --> D[新增功能]
                        
                        B --> B1[混合专家模型 MoE]
                        B --> B2[128K上下文]
                        B --> B3[338种语言支持]
                        
                        C --> C1[对标GPT-4-Turbo]
                        C --> C2[低成本推理]
                        C --> C3[数学推理领先]
                        
                        D --> D1[代码解释修复]
                        D --> D2[多模态扩展]
                </div>
            </div>
        </section>
        
        <div class="section-divider my-12"></div>
        
        <!-- Deployment Section -->
        <section id="deployment" class="mb-20">
            <div class="flex items-center mb-12">
                <div class="w-12 h-1 bg-blue-500 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">环境部署与配置</h2>
            </div>
            
            <div class="mb-12">
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">硬件要求</h3>
                <div class="table-container bg-white rounded-xl shadow-md overflow-hidden">
                    <table class="w-full">
                        <thead>
                            <tr>
                                <th>配置类型</th>
                                <th>CPU</th>
                                <th>GPU</th>
                                <th>内存</th>
                                <th>存储</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>高性能</td>
                                <td>2×Xeon Gold 64核</td>
                                <td>8×NVIDIA A100</td>
                                <td>1024GB</td>
                                <td>1TB SSD</td>
                            </tr>
                            <tr>
                                <td>中端</td>
                                <td>2×AMD EPYC 32核</td>
                                <td>4×NVIDIA A40</td>
                                <td>512GB</td>
                                <td>500GB SSD</td>
                            </tr>
                            <tr>
                                <td>最低要求</td>
                                <td>1×Xeon Gold 64核</td>
                                <td>2×NVIDIA A30</td>
                                <td>256GB</td>
                                <td>250GB SSD</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <p class="mt-4 text-gray-600 italic">建议使用 CUDA 12.1+ 与 PyTorch 2.0+ 环境。</p>
            </div>
            
            <div>
                <h3 class="text-2xl font-semibold mb-6 text-gray-800">安装步骤</h3>
                <div class="space-y-8">
                    <div class="bg-white rounded-xl shadow-md overflow-hidden">
                        <div class="p-4 bg-gray-800 text-white font-mono text-sm flex items-center">
                            <div class="flex space-x-2 mr-4">
                                <div class="w-3 h-3 rounded-full bg-red-500"></div>
                                <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
                                <div class="w-3 h-3 rounded-full bg-green-500"></div>
                            </div>
                            <span>1. 安装依赖库</span>
                        </div>
                        <div class="code-block p-4">
                            <pre><code class="text-white">pip install torch transformers accelerate</code></pre>
                        </div>
                    </div>
                    
                    <div class="bg-white rounded-xl shadow-md overflow-hidden">
                        <div class="p-4 bg-gray-800 text-white font-mono text-sm flex items-center">
                            <div class="flex space-x-2 mr-4">
                                <div class="w-3 h-3 rounded-full bg-red-500"></div>
                                <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
                                <div class="w-3 h-3 rounded-full bg-green-500"></div>
                            </div>
                            <span>2. 下载模型权重</span>
                        </div>
                        <div class="code-block p-4">
                            <pre><code class="text-white">from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
    "deepseek-ai/DeepSeek-Coder-V2-Instruct", 
    trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
    "deepseek-ai/DeepSeek-Coder-V2-Instruct"
)</code></pre>
                        </div>
                    </div>
                    
                    <div class="bg-white rounded-xl shadow-md overflow-hidden">
                        <div class="p-4 bg-gray-800 text-white font-mono text-sm flex items-center">
                            <div class="flex space-x-2 mr-4">
                                <div class="w-3 h-3 rounded-full bg-red-500"></div>
                                <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
                                <div class="w-3 h-3 rounded-full bg-green-500"></div>
                            </div>
                            <span>3. 本地部署优化 (使用vLLM加速推理)</span>
                        </div>
                        <div class="code-block p-4">
                            <pre><code class="text-white">pip install vllm
python -m vllm.entrypoints.api_server \
    --model deepseek-ai/DeepSeek-Coder-V2-Instruct</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <div class="section-divider my-12"></div>
        
        <!-- Practical Examples -->
        <section id="examples" class="mb-20">
            <div class="flex items-center mb-12">
                <div class="w-12 h-1 bg-blue-500 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">开发场景实战</h2>
            </div>
            
            <div class="space-y-16">
                <!-- Code Generation -->
                <div>
                    <h3 class="text-2xl font-semibold mb-6 text-gray-800 flex items-center">
                        <i class="fas fa-code text-blue-500 mr-2"></i> 代码生成
                    </h3>
                    <div class="bg-white rounded-xl shadow-md overflow-hidden">
                        <div class="p-4 bg-gray-800 text-white font-mono text-sm flex items-center">
                            <div class="flex space-x-2 mr-4">
                                <div class="w-3 h-3 rounded-full bg-red-500"></div>
                                <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
                                <div class="w-3 h-3 rounded-full bg-green-500"></div>
                            </div>
                            <span>示例1：快速生成算法 (二叉树的层序遍历)</span>
                        </div>
                        <div class="p-4">
                            <h4 class="font-semibold text-gray-800 mb-2">输入提示：</h4>
                            <div class="code-block p-4 mb-4">
                                <pre><code class="text-white"># 实现二叉树的层序遍历（Python）</code></pre>
                            </div>
                            
                            <h4 class="font-semibold text-gray-800 mb-2">模型输出：</h4>
                            <div class="code-block p-4">
                                <pre><code class="text-white">from collections import deque
def level_order(root):
    if not root: return []
    queue = deque([root])
    result = []
    while queue:
        level_size = len(queue)
        current_level = []
        for _ in range(level_size):
            node = queue.popleft()
            current_level.append(node.val)
            if node.left: queue.append(node.left)
            if node.right: queue.append(node.right)
        result.append(current_level)
    return result</code></pre>
                            </div>
                        </div>
                        <div class="bg-gray-50 p-4 border-t border-gray-200 text-sm text-gray-600">
                            <i class="fas fa-info-circle text-blue-500 mr-1"></i> 支持复杂度分析与边界条件处理
                        </div>
                    </div>
                </div>
                
                <!-- Debugging -->
                <div>
                    <h3 class="text-2xl font-semibold mb-6 text-gray-800 flex items-center">
                        <i class="fas fa-bug text-blue-500 mr-2"></i> 代码调试
                    </h3>
                    <div class="bg-white rounded-xl shadow-md overflow-hidden">
                        <div class="p-4 bg-gray-800 text-white font-mono text-sm flex items-center">
                            <div class="flex space-x-2 mr-4">
                                <div class="w-3 h-3 rounded-full bg-red-500"></div>
                                <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
                                <div class="w-3 h-3 rounded-full bg-green-500"></div>
                            </div>
                            <span>错误诊断</span>
                        </div>
                        <div class="p-4">
                            <h4 class="font-semibold text-gray-800 mb-2">上传报错代码：</h4>
                            <div class="code-block p-4 mb-4">
                                <pre><code class="text-white">def divide(a, b):
    return a / b
print(divide(10, 0))  # 多余括号</code></pre>
                            </div>
                            
                            <h4 class="font-semibold text-gray-800 mb-2">模型返回：</h4>
                            <div class="bg-gray-100 p-4 rounded-lg">
                                <p class="font-mono text-red-600">错误：SyntaxError（括号不匹配）</p>
                                <p class="font-mono">修复建议：删除多余右括号 → print(divide(10, 0))</p>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- Cross-file Collaboration -->
                <div>
                    <h3 class="text-2xl font-semibold mb-6 text-gray-800 flex items-center">
                        <i class="fas fa-project-diagram text-blue-500 mr-2"></i> 跨文件协作
                    </h3>
                    <div class="bg-white p-6 rounded-xl shadow-md">
                        <p class="text-gray-700"><span class="first-letter">在</span>大型项目中，模型可解析文件依赖关系，生成符合项目结构的代码片段（需启用 Repo-Level 模式）。</p>
                    </div>
                </div>
            </div>
        </section>
        
        <div class="section-divider my-12"></div>
        
        <!-- Advanced Features -->
        <section id="advanced" class="mb-20">
            <div class="flex items-center mb-12">
                <div class="w-12 h-1 bg-blue-500 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">高级功能与优化</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white p-8 rounded-xl shadow-md">
                    <h3 class="text-xl font-bold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-comment-dots text-blue-500 mr-2"></i> 提示词工程
                    </h3>
                    <div class="space-y-4">
                        <div>
                            <h4 class="font-semibold text-gray-800 mb-2">结构化指令</h4>
                            <div class="code-block p-4">
                                <pre><code class="text-white">输入：{代码片段}
要求：将变量名改为驼峰式命名，并添加类型注解</code></pre>
                            </div>
                        </div>
                        <div>
                            <h4 class="font-semibold text-gray-800 mb-2">思维链(CoT)</h4>
                            <p class="text-gray-700">复杂任务中添加 <span class="bg-gray-100 px-2 py-1 rounded font-mono">请分步骤思考后生成代码</span>，提升生成质量</p>
                        </div>
                    </div>
                </div>
                
                <div class="bg-white p-8 rounded-xl shadow-md">
                    <h3 class="text-xl font-bold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-tools text-blue-500 mr-2"></i> 性能调优
                    </h3>
                    <div>
                        <h4 class="font-semibold text-gray-800 mb-2">量化压缩</h4>
                        <p class="text-gray-700 mb-3">使用 <span class="bg-gray-100 px-2 py-1 rounded font-mono">bitsandbytes</span> 进行 8-bit 量化，显存占用减少 40%</p>
                        <div class="code-block p-4">
                            <pre><code class="text-white">model = AutoModelForCausalLM.from_pretrained(
    ...,
    load_in_8bit=True
)</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <div class="section-divider my-12"></div>
        
        <!-- Ecosystem Integration -->
        <section id="ecosystem" class="mb-20">
            <div class="flex items-center mb-12">
                <div class="w-12 h-1 bg-blue-500 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">生态整合</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white p-8 rounded-xl shadow-md">
                    <h3 class="text-xl font-bold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-plug text-blue-500 mr-2"></i> IDE 插件开发
                    </h3>
                    <ul class="space-y-4 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-check text-blue-500 mt-1 mr-2"></i>
                            <div>
                                <strong>VS Code 集成</strong>：通过 API 实现实时代码补全与重构
                                <p class="text-sm text-gray-500 mt-1">参考 Supermaven + Continue Dev 方案</p>
                            </div>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-blue-500 mt-1 mr-2"></i>
                            <div>
                                <strong>Jupyter 支持</strong>：结合 <span class="bg-gray-100 px-1 rounded font-mono">ipywidgets</span> 创建交互式代码生成界面
                            </div>
                        </li>
                    </ul>
                </div>
                
                <div class="bg-white p-8 rounded-xl shadow-md">
                    <h3 class="text-xl font-bold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-eye text-blue-500 mr-2"></i> 多模态扩展
                    </h3>
                    <div class="text-gray-700">
                        <p><i class="fas fa-check text-blue-500 mr-2"></i> <strong>与 DeepSeek-VL2 联动</strong>：实现图像到代码的转换（如将 UML 图转化为类结构代码）</p>
                    </div>
                </div>
            </div>
        </section>
        
        <div class="section-divider my-12"></div>
        
        <!-- Model Downloads -->
        <section id="download" class="mb-20">
            <div class="flex items-center mb-12">
                <div class="w-12 h-1 bg-blue-500 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">模型下载</h2>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="p-6 md:p-8">
                    <p class="text-gray-700 mb-6">发布了基于 <a href="https://arxiv.org/pdf/2401.06066" target="_blank" class="text-blue-500 hover:underline">DeepSeekMoE</a> 框架的具有 16B 和 236B 参数的 DeepSeek-Coder-V2，该框架的活跃参数仅为 2.4B 和 21B，包括 base 和 instruct 模型。</p>
                    
                    <div class="table-container">
                        <table class="w-full">
                            <thead>
                                <tr>
                                    <th>Model</th>
                                    <th>#Total Params</th>
                                    <th>#Active Params</th>
                                    <th>Context Length</th>
                                    <th>Download</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>DeepSeek-Coder-V2-Lite-Base</td>
                                    <td>16B</td>
                                    <td>2.4B</td>
                                    <td>128K</td>
                                    <td>
                                        <a href="https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Lite-Base" target="_blank" class="text-blue-500 hover:underline">
                                            🤗 HuggingFace
                                        </a>
                                    </td>
                                </tr>
                                <tr>
                                    <td>DeepSeek-Coder-V2-Lite-Instruct</td>
                                    <td>16B</td>
                                    <td>2.4B</td>
                                    <td>128K</td>
                                    <td>
                                        <a href="https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct" target="_blank" class="text-blue-500 hover:underline">
                                            🤗 HuggingFace
                                        </a>
                                    </td>
                                </tr>
                                <tr>
                                    <td>DeepSeek-Coder-V2-Base</td>
                                    <td>236B</td>
                                    <td>21B</td>
                                    <td>128K</td>
                                    <td>
                                        <a href="https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Base" target="_blank" class="text-blue-500 hover:underline">
                                            🤗 HuggingFace
                                        </a>
                                    </td>
                                </tr>
                                <tr>
                                    <td>DeepSeek-Coder-V2-Instruct</td>
                                    <td>236B</td>
                                    <td>21B</td>
                                    <td>128K</td>
                                    <td>
                                        <a href="https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Instruct" target="_blank" class="text-blue-500 hover:underline">
                                            🤗 HuggingFace
                                        </a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </section>
        
        <div class="section-divider my-12"></div>
        
        <!-- Chat & API -->
        <section id="chat-api" class="mb-20">
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white p-8 rounded-xl shadow-md">
                    <h3 class="text-xl font-bold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-comments text-blue-500 mr-2"></i> 聊天网站
                    </h3>
                    <p class="text-gray-700 mb-4">可以在 DeepSeek 的官方网站上与 DeepSeek-Coder-V2 聊天：</p>
                    <a href="https://coder.deepseek.com/sign_in" target="_blank" class="inline-block bg-blue-500 hover:bg-blue-600 text-white px-6 py-3 rounded-lg font-semibold transition duration-300">
                        访问聊天网站
                    </a>
                </div>
                
                <div class="bg-white p-8 rounded-xl shadow-md">
                    <h3 class="text-xl font-bold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-cloud text-blue-500 mr-2"></i> API平台
                    </h3>
                    <p class="text-gray-700 mb-4">DeepSeek Platform 上提供兼容 OpenAI 的 API，您也可以以无与伦比的价格按量付费。</p>
                    <a href="https://platform.deepseek.com/" target="_blank" class="inline-block bg-blue-500 hover:bg-blue-600 text-white px-6 py-3 rounded-lg font-semibold transition duration-300">
                        访问API平台
                    </a>
                </div>
            </div>
            
            <div class="mt-8 bg-white rounded-xl shadow-md overflow-hidden">
                <img src="https://cdn.nlark.com/yuque/0/2025/png/21449790/1743602793241-82153e32-28cd-4a25-a162-151224478d70.png" alt="DeepSeek API Interface" class="w-full">
            </div>
        </section>
        
        <div class="section-divider my-12"></div>
        
        <!-- Local Running -->
        <section id="local" class="mb-20">
            <div class="flex items-center mb-12">
                <div class="w-12 h-1 bg-blue-500 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">如何在本地运行</h2>
            </div>
            
            <div class="bg-white p-8 rounded-xl shadow-md">
                <p class="text-gray-700 mb-4">提供了一些如何使用 DeepSeek-Coder-V2-Lite 模型的示例。如果您想使用 BF16 格式的 DeepSeek-Coder-V2 进行推理，则需要 80GB*8 个 GPU。</p>
                
                <h3 class="text-xl font-semibold mb-4 text-gray-800">使用 Huggingface 的 Transformer 进行推理</h3>
                <p class="text-gray-700 mb-6">您可以直接使用 <a href="https://github.com/huggingface/transformers" target="_blank" class="text-blue-500 hover:underline">Huggingface 的 Transformers</a> 进行模型推理。</p>
                
                <div class="code-block p-4">
                    <pre><code class="text-white"># 示例代码片段
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "deepseek-ai/DeepSeek-Coder-V2-Instruct"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    device_map="auto",
    torch_dtype=torch.bfloat16
)

inputs = tokenizer("def fibonacci(n):", return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))</code></pre>
                </div>
            </div>
        </section>
    </main>
    
    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-12">
        <div class="container mx-auto max-w-5xl px-4 md:px-0">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold text-white mb-2">技术小馆</h3>
                    <p class="text-gray-400">探索前沿科技，分享技术知识</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" target="_blank" class="text-gray-300 hover:text-white transition duration-300">
                        <i class="fas fa-link mr-2"></i> http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="mt-8 pt-8 border-t border-gray-800 text-center text-gray-500 text-sm">
                <p>© 2023 技术小馆. All rights reserved.</p>
            </div>
        </div>
    </footer>
    
    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
        
        // Smooth scrolling for anchor links
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });
    </script>
</body>
</html>